const { configureTable } = require('../../schemas/index');
const { getResJson } = require('../../assets/util');

/**
 * 通过 type 查询配置表信息
 * @param {Object} params 参数
 * @param {Function} callback 回调函数
 */
exports.searchConfigure = (params, callback) => {
    configureTable.find({ 'type': params.type }, (err, data) => {
        let resJson = {};
        if (err) {
            resJson = getResJson(data, '查询失败', false);
        } else {
            resJson = getResJson(data, '查询成功');
        }
        callback(resJson);
    })
}